<template>
  <section v-loading="loading" class="cms-body">
    <div class="cms-list-header flex-between">
      <div>
        <cms-input label="任务名称" v-model="params.taskName"></cms-input>
        <el-button @click="goQuery()">查询</el-button>
      </div>
    </div>
    <!-- 表格 -->
    <el-table :data="tableData" stripe style="width: 100%" @selection-change="checkIds">


      <el-table-column prop="id" label="id" width="60" align="center"></el-table-column>

      <el-table-column prop="taskName" label="任务名称" width="180" align="left"></el-table-column>

      <el-table-column prop="taskIcon" label="任务图标" align="center">
        <template slot-scope="scope">
          <img :src="scope.row.taskIcon |imgPathFilter" width="50" height="50">
        </template>
      </el-table-column>

      <el-table-column prop="taskNum" label="任务次数" width="120" align="center"></el-table-column>

      <el-table-column prop="singleIntegralValue" label="单次积分" width="120" align="center"></el-table-column>

      <el-table-column prop="integralValue" label="总积分" width="120" align="center"></el-table-column>

      <el-table-column prop="createTime" label="创建日期" width="140" align="center"></el-table-column>

      <el-table-column label="操作" align="center" width="80">
        <div slot-scope="scope">
          <cms-button type="edit" @click.native="routerLink('/integralTask/update','update',scope.row.id)" v-perms="'/integralTask/update'"></cms-button>
        </div>
      </el-table-column>
    </el-table>

    <!-- 表格底部 -->
    <div class="cms-list-footer">
      <div class="cms-left"></div>
      <!-- cms分页组件 -->
      <cms-pagination :total="total" @change="getPages"></cms-pagination>
    </div>

  </section>
</template>

<script>
  import listMixins from '@/mixins/list'

  export default {
    mixins: [listMixins],
    data() {
      return {
        params: {//只需要业务参数
          pageNo: 1,
          pageSize: 10,
          taskName: '',
        }

      };
    },
    methods: {
      goQuery() {
        this.getTableData(this.params);
      }
    },
    created() {
      this.initTableData(this.$api.integralTaskPageList, this.params);
    }
  };
</script>

<style>

</style>
